package com.jh.user.pojo.enums;

import cn.jh.common.tools.Strings;

/**
 * 通道商户类型枚举
 *
 * @author Yichuan
 * @version 1.0
 */
public enum ChannelMerType {

    LDSH("1", "落地商户"),

    XSSH("2", "线上商户"),

    ;

    final String value;
    final String desc;

    ChannelMerType(String value, String desc) {
        this.value = (String) value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ChannelMerType of(String value) {
        if (Strings.isNullOrEmpty(value)) {
            return null;
        }
        if (value.equalsIgnoreCase("1")) {
            return LDSH;
        } else if (value.equalsIgnoreCase("2")) {
            return XSSH;
        } else {
            return null;
        }
    }
}
